public class SimpleSelectSort{
    /**
     *
     * @param start
     * @param array
     * @return
     */
    public static int findMin(int start,int[]array){
        int min = array[start];
        int index =start;
        for(int i =start;i<array.length;i++){

            if(array[i]<=min){
                min=array[i];
                index = i;

            }

        }

        return index;
    }
    public static void sort(int[] array){
        int i=0;
        while(i<array.length){
            int min = findMin(i, array);
            System.out.println(array[min]);
            if(min!=i){

                int temp = array[i];
                array[i]= array[min];
                array[min] = temp;
            }
            i++;
        }
    }

    public static void main(String[] args) {
        int[] array={3,6,8,9,0,1,7,2,4,5};
         sort(array);
        for(int i =0;i<array.length;i++){
            System.out.print(array[i]);
        }
    }
}

